/* eslint-disable @typescript-eslint/no-empty-function */
import { h, createApp } from "vue";
import singleSpaVue from "single-spa-vue";
import App from "./App.vue";
import router from "./router";
let vueLifecycles: any;
if (process.env.VUE_APP_SINGLE == "yes") {
  console.log("single");
  vueLifecycles = singleSpaVue({
    createApp,
    appOptions: {
      render() {
        return h(App, {});
      },
    },
    handleInstance(app) {
      app.use(router);
      app.mount("#sub-project");
    },
  });
} else {
  const app = createApp(App);
  app.use(router).mount("#sub-project");
}

export const bootstrap = () => {
  return vueLifecycles?.bootstrap(() => {});
};
export const mount = () => {
  return vueLifecycles?.mount(() => {});
};
export const unmount = () => {
  return vueLifecycles.unmount(() => {});
};
